import psutil
import sys


def get_terminal_type():
    if sys.platform == "win32":
        parent_pid = psutil.Process().ppid()
        parent = psutil.Process(parent_pid)
        parent_name = parent.name().lower()

        if "cmd" in parent_name:
            return "CMD or Command Prompt"
        elif "powershell" in parent_name:
            return "PowerShell"
        else:
            return "Unknown Terminal"
    else:
        return "Not on Windows platform"


terminal_type = get_terminal_type()
print(f"Running in: {terminal_type}")